package com.dwd.servicemanager.mapper;

import com.dwd.basic.mapper.BaseMapper;
import com.dwd.basic.utils.PageBean;
import com.dwd.servicemanager.pojo.Product;
import com.dwd.servicemanager.pojo.dto.ProductDto;
import com.dwd.servicemanager.query.ProductQuery;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/21 15:23
 * @Version 1.0
 */
@Repository
@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    /**
     * 上架
     * @param id
     */
    void up(Long id);

    /**
     * 下架
     * @param id
     */
    void down(Long id);

    /**
     * 批量下架
     * @param products
     */
    void batchDown(List<Product> products);

    /**
     * 批量删除
     * @param products
     */
    void batchDelete(List<Product> products);

    /**
     * 销量降序
     * @param productQuery
     * @return
     */
    List<Product> queryPageSalecount(ProductQuery productQuery);

    /**
     * 价格降序
     * @param productQuery
     * @return
     */
    List<Product> queryPageSaleprice(ProductQuery productQuery);

    /**
     * 根据id查询对应的产品
     * @param id
     * @return
     */
    Product queryProductById(Long id);
}
